/**
 * 2. 调节方式-调度约束
 */

function yueSCDisplayData(){
	var link = "szy/dispatch/wateroptimum/yueSchedulingConstraints";
	$.ajax({
	//	url: "http://localhost:8080/Springwap/"+link+".shtml",
		url: config.URL+link,
		type: "post",
		data: {},
		dataType: "json",
		success: function(result) {
			Ext.data.StoreManager.lookup('yueSCstore2_2').setData(result.index1);
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			Ext.Msg.alert('提示', '读取初始条件时发生了错误！');
		}
	});
}

Ext.define('Admin.view.needwater.subpage.schedulingConstraints',{
	extend:'Ext.grid.Panel',
	xtype:'yueSchedulingConstraints',
	//起别名
	alias:'yueSchedulingConstraints',
	require:[],
	user:[],
	userCLs:'big-100 small-100',
//	xtype: 'grid',
	border: true,
	store: {xtype:'store', storeId: 'yueSCstore2_2'},
	padding: '0 10 10 10',
//	minHeight: 500,
	columns: [
		{ text: '时间', dataIndex: 'index1', width:'11.5%', minWidth: 100, align: 'center' },
		{text: '洪门', width: '44%', minWidth: 720, columns:[{ text: '最高水位(m)', dataIndex: 'index2', minWidth: 120, width:'16%', align: 'center', formatter: 'round(3)' },
			{ text: '最低水位(m)', dataIndex: 'index3', minWidth: 120, width:'16%', align: 'center', formatter: 'round(3)' },
			{ text: '最大下泄(m³/s)', dataIndex: 'index4', minWidth: 120, width:'17%', align: 'center', formatter: 'round(3)' },
			{ text: '最小下泄(m³/s)', dataIndex: 'index5', minWidth: 120, width:'17%', align: 'center', formatter: 'round(3)' },
			{ text: '最大出力(kW)', dataIndex: 'index6', minWidth: 120, width:'17%', align: 'center', formatter: 'round(3)' },
			{ text: '最小出力(kW)', dataIndex: 'index7', minWidth: 120, width:'17%', align: 'center', formatter: 'round(3)' }]},
		{text: '廖坊', width: '44%', minWidth: 720, columns:[{ text: '最高水位(m)', dataIndex: 'index8', minWidth: 120, width:'16%', align: 'center', formatter: 'round(3)' },
			{ text: '最低水位(m)', dataIndex: 'index9', minWidth: 120, width:'16%', align: 'center', formatter: 'round(3)' },
			{ text: '最大下泄(m³/s)', dataIndex: 'index10', minWidth: 120, width:'17%', align: 'center', formatter: 'round(3)' },
			{ text: '最小下泄(m³/s)', dataIndex: 'index11', minWidth: 120, width:'17%', align: 'center', formatter: 'round(3)' },
			{ text: '最大出力(kW)', dataIndex: 'index12', minWidth: 120, width:'17%', align: 'center', formatter: 'round(3)' },
			{ text: '最小出力(kW)', dataIndex: 'index13', minWidth: 120, width:'17%', align: 'center', formatter: 'round(3)' }]}
	],
	listeners: {
		boxready: {
			fn: function(){
				yueSCDisplayData();
			}
		}
	}
});